﻿using BarManager.Core.ApplicationService.Interfaces;
using System.Web;
using System.Web.Security;

namespace BarManager.Core.ApplicationService
{
    public class AuthenticationService : IAuthenticationService
    {
        public bool Authenticate(string user, string password)
        {
            bool result = FormsAuthentication.Authenticate(user, password);
            if (result) FormsAuthentication.SetAuthCookie(user, false);
            return result;
        }

        public void Logout()
        {
            FormsAuthentication.SignOut();
        }
    }
}
